﻿<Window x:Class="HMS.ChannlingWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"       
        xmlns:toolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit"
        xmlns:xctk="clr-namespace:Xceed.Wpf.Toolkit;assembly=WPFToolkit.Extended"
        Style="{StaticResource ControlBackgroundStyle}"
        Name="ChannelingWindow"
        WindowStartupLocation="CenterScreen"
        ResizeMode="NoResize"
        Title="Channling" Height="505" Width="511">
    
    <Grid >
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            
        </Grid.RowDefinitions>
        <StackPanel Orientation="Horizontal">
        <StackPanel Orientation="Vertical" Grid.Row="0">
            
            <GroupBox Header="Channeling Details" Grid.Row="0"  Background="{x:Null}">
                <WrapPanel Orientation="Vertical">
                        <StackPanel Name="ReferenceStackPanel"  Orientation="Horizontal">
                            <Label Content="Reference:" Style="{StaticResource RightAlignedControlLabelStyle}" />
                            <toolkit:AutoCompleteBox Name="ReferenceAutocompleteTextBox" 
                                                 ItemsSource="{Binding}"
                                                 ValueMemberPath="Reference"
                                                 ToolTipService.ToolTip="Enter Reference."
                                                 IsTextCompletionEnabled="True"
                                                 Style="{StaticResource LeftAlignedControlAutoCompleteTextBoxStyle}" 
                                                 FilterMode="StartsWith" SelectionChanged="ReferenceAutocompleteTextBox_SelectionChanged">
                                <toolkit:AutoCompleteBox.ItemTemplate>
                                    <DataTemplate>
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Text="{Binding Path=Reference}"/>
                                            <TextBlock Text="-"/>
                                            <TextBlock Text="{Binding Path=Patient.Name}"/>
                                        </StackPanel>
                                    </DataTemplate>
                                </toolkit:AutoCompleteBox.ItemTemplate>
                            </toolkit:AutoCompleteBox>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                        <Label Content="Doctor Type:" Style="{StaticResource RightAlignedControlLabelStyle}" />
                        <toolkit:AutoCompleteBox Name="DoctorTypeAutocompleteTextBox" 
                                                 ItemsSource="{Binding}"
                                                 ValueMemberPath="Name"
                                                 ToolTipService.ToolTip="Enter Doctor Type."
                                                 IsTextCompletionEnabled="True"
                                                 Style="{StaticResource LeftAlignedControlAutoCompleteTextBoxStyle}" 
                                                 FilterMode="StartsWith" SelectionChanged="DoctorTypeAutocompleteTextBox_SelectionChanged">
                            <toolkit:AutoCompleteBox.ItemTemplate>
                                <DataTemplate>
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock Text="{Binding Path=Name}"/>                                     
                                    </StackPanel>
                                </DataTemplate>
                            </toolkit:AutoCompleteBox.ItemTemplate>
                        </toolkit:AutoCompleteBox>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <Label Content="Doctor Name:" Style="{StaticResource RightAlignedControlLabelStyle}" />
                        <toolkit:AutoCompleteBox Name="DoctorAutocompleteTextBox" 
                                                 DataContext="{Binding}"
                                                 ValueMemberPath="Name"
                                                 IsTextCompletionEnabled="True"
                                                 Style="{StaticResource LeftAlignedControlAutoCompleteTextBoxStyle}" 
                                                 FilterMode="StartsWith" SelectionChanged="DoctorAutocompleteTextBox_SelectionChanged">
                            <toolkit:AutoCompleteBox.ItemTemplate>
                                <DataTemplate>
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock Text="{Binding Path=Title}"/>
                                        <TextBlock Text="{Binding Path=Name}"/>
                                    </StackPanel>
                                </DataTemplate>
                            </toolkit:AutoCompleteBox.ItemTemplate>
                        </toolkit:AutoCompleteBox>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                            <Label Content="Appointment :" VerticalAlignment="Top" Style="{StaticResource RightAlignedControlLabelStyle}" />
                            <DatePicker Name="AppointmentDatePicker" Style="{StaticResource LeftAlignedControlDatePickerStyle}" SelectedDateChanged="AppointmentDatePicker_SelectedDateChanged" />
                    </StackPanel>
                    <StackPanel  Orientation="Horizontal">
                        <Label Content="Channeling Hour:" Style="{StaticResource RightAlignedControlLabelStyle}" />
                            <ComboBox Name="ChannelingHourComboBox" Style="{StaticResource LeftAlignedControlComboboxBoxStyle}" 
                                  ItemsSource="{Binding}" SelectedValuePath="ChannelingHourID" SelectionChanged="ChannelingHourComboBox_SelectionChanged">
                                <ComboBox.ItemTemplate>
                                    <DataTemplate>
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Text="{Binding Name}" />
                                            <TextBlock Text=" - " />
                                            <TextBlock Text="{Binding StartTime}" />
                                            <TextBlock Text=" to " />
                                            <TextBlock Text="{Binding EndTime}" />
                                        </StackPanel>
                                    </DataTemplate>
                                </ComboBox.ItemTemplate>
                            </ComboBox>
                        </StackPanel>
                 </WrapPanel>
            </GroupBox>
            <GroupBox Header="Patient Details" Grid.Row="0" Background="{x:Null}">
                <WrapPanel Orientation="Vertical">
                <StackPanel Orientation="Horizontal">
                    <Label Content="Patient Name:" Style="{StaticResource RightAlignedControlLabelStyle}" />
                    <TextBox Name="PatientNameTextBox" Style="{StaticResource LeftAlignedControlTextBoxStyle}"/>
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <Label Content="Age:" Style="{StaticResource RightAlignedControlLabelStyle}" />
                            <xctk:IntegerUpDown Name="PatientAgeIntegerUpDown" Value="0" Maximum="120" Minimum="0" Style="{StaticResource LeftAlignedControlIntegerUpDownStyle}"/>
                </StackPanel>
                        <StackPanel Orientation="Horizontal">
                    <Label Content="Contact No:" Style="{StaticResource RightAlignedControlLabelStyle}" />
                    <xctk:MaskedTextBox Mask="0000-000000" Value="0112898476" Name="PatientContactNoTextBox" Style="{StaticResource LeftAlignedControlTextBoxStyle}"/>
                </StackPanel>
                </WrapPanel>
            </GroupBox>
            <GroupBox Header="Payment Details" Grid.Row="0" Background="{x:Null}">
                <WrapPanel Orientation="Vertical">
                    <StackPanel Orientation="Horizontal">
                        <Label Content="Phone Booking :" Style="{StaticResource RightAlignedControlLabelStyle}" />
                        <CheckBox Name="IsPhoneBookingCheckBox" Style="{StaticResource LeftAlignedControlCheckBoxStyle}" Checked="IsPhoneBookingCheckBox_Checked" Unchecked="IsPhoneBookingCheckBox_Unchecked" />
                    </StackPanel>
                    <StackPanel Name="PaymentMethodStackPanel" Orientation="Horizontal">
                        <Label Content="Payment Method:" Style="{StaticResource RightAlignedControlLabelStyle}" />
                        <ComboBox Name="PaymentMethodComboBox"  Style="{StaticResource LeftAlignedControlComboboxBoxStyle}"
                                  SelectedValuePath="PaymentMethodID" 
                                  DisplayMemberPath="Name"
                                  ItemsSource="{Binding}"/>
                    </StackPanel>
                    <StackPanel   Orientation="Horizontal" HorizontalAlignment="Left">
                        <StackPanel Orientation="Horizontal">
                            <Label Content="Print Receipt :" Style="{StaticResource RightAlignedControlLabelStyle}" />
                            <CheckBox Name="PrintReceiptCheckBox" IsChecked="True" Style="{StaticResource LeftAlignedControlCheckBoxStyle}"  />
                        </StackPanel>
                    </StackPanel>
                    </WrapPanel>

            </GroupBox>
            
        </StackPanel> 
            <GroupBox Header="Summary" Grid.Row="0" HorizontalAlignment="Stretch" Background="{x:Null}">
                <WrapPanel Orientation="Vertical">
                <StackPanel Orientation="Horizontal">
                    <Label  Content="Patient No:" Style="{StaticResource RightAlignedControlLabelStyle}" />
                    <TextBlock Name="PatientNumberTextBlock" FontSize="50" Style="{StaticResource LeftAlignedControlTextBlockStyle}" Height="64">0</TextBlock>
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                        <TextBlock   FontSize="13" Style="{StaticResource RightAlignedControlTextBlockStyle}">Appoinment Time:</TextBlock>
                        <TextBlock Name="AppoinmentTimeTextBlock"  FontSize="13" Style="{StaticResource LeftAlignedControlTextBlockStyle}">0:00 AM</TextBlock>                       
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock   FontSize="13" Style="{StaticResource RightAlignedControlTextBlockStyle}">Hospital Fee:</TextBlock>
                        <TextBlock Name="HospitalFeeTextBlock"  FontSize="16" Style="{StaticResource LeftAlignedControlTextBlockStyle}">0.00</TextBlock>
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                        <TextBlock   FontSize="13" Style="{StaticResource RightAlignedControlTextBlockStyle}">Doctor Fee:</TextBlock>
                        <TextBlock Name="DoctorFeeTextBlock" FontSize="16" Style="{StaticResource LeftAlignedControlTextBlockStyle}">0.00</TextBlock>
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                        <TextBlock   FontSize="13" Style="{StaticResource RightAlignedControlTextBlockStyle}">Total Amount:</TextBlock>
                        <TextBlock Name="TotalReceiptAmountTextBlock" FontSize="20" Style="{StaticResource LeftAlignedControlTextBlockStyle}">0.00</TextBlock>
                </StackPanel>
       
                </WrapPanel>
            </GroupBox>
        </StackPanel>
        <Rectangle  Grid.Row="1"  Style="{StaticResource HorizontalLineStyle }" />
        <StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right">
            <Button Name="NewButton"  Style="{StaticResource LargeButtonStyle}" Click="NewButton_Click">
                <StackPanel Orientation="Horizontal" >
                    <Image   Source="images/icons/24x24/new.png" Style="{StaticResource Image24x24Style}" />
                    <TextBlock  FontSize="16" Style="{StaticResource ButtonTextControlTextBlockStyle}">New</TextBlock>
                </StackPanel>
            </Button>
            <Button Name="PrintButton"  Style="{StaticResource LargeButtonStyle}" Click="PrintButton_Click">
                <StackPanel Orientation="Horizontal" >
                    <Image   Source="images/icons/24x24/print.png" Style="{StaticResource Image24x24Style}" />
                    <TextBlock  FontSize="16" Style="{StaticResource ButtonTextControlTextBlockStyle}">Print</TextBlock>
                </StackPanel>
            </Button>
            <Button Name="SaveButton"  Style="{StaticResource LargeButtonStyle}" Click="SaveButton_Click">
                <StackPanel Orientation="Horizontal" >
                    <Image Source="images/icons/24x24/right.png" Style="{StaticResource Image24x24Style}" />
                    <TextBlock FontSize="16" Style="{StaticResource ButtonTextControlTextBlockStyle}">Save</TextBlock>
                </StackPanel>
            </Button>
            <!--<Button Name="RefreshSummaryButton"  Style="{StaticResource LargeButtonStyle}" Click="RefreshSummaryButton_Click">
                <StackPanel Orientation="Horizontal" >
                    <Image Source="images/icons/24x24/refresh.png" Style="{StaticResource Image24x24Style}" />
                    <TextBlock FontSize="16" Style="{StaticResource ButtonTextControlTextBlockStyle}">Refresh</TextBlock>
                </StackPanel>
            </Button>-->
            <Button Name="CancelButton"  Style="{StaticResource LargeButtonStyle}" Click="Cancelbutton_Click">
                <StackPanel Orientation="Horizontal" >
                    <Image Source="images/icons/24x24/cancel.png" Style="{StaticResource Image24x24Style}" />
                    <TextBlock FontSize="16" Style="{StaticResource ButtonTextControlTextBlockStyle}">Cancel</TextBlock>
                </StackPanel>
            </Button>
            

            <Button Name="CloseButton"  Style="{StaticResource LargeButtonStyle}" Click="CloseButton_Click">
                <StackPanel Orientation="Horizontal" >
                    <Image Source="images/icons/24x24/cross.png" Style="{StaticResource Image24x24Style}" />
                    <TextBlock FontSize="16" Style="{StaticResource ButtonTextControlTextBlockStyle}">Close</TextBlock>
                </StackPanel>
            </Button>
        </StackPanel>
        
       
    </Grid>
</Window>
